import java.util.*;
public class Main {

	public static void main(String[] args) {
		Monticulo m = new Monticulo();
		Posicion p = new Posicion(1,1);
		double coste, f;
		coste = 3;
		long profundidad = 4;
		Nodo padre = new Nodo();
		Random r = new Random();
		double itime, ftime, maxtime=-1, mintime=99999, avtime, tottime=0;

		for(int i=0;i<1000;i++){
			f=r.nextInt(1000);
			try{
				itime=System.currentTimeMillis();
				m.add(new Nodo(p,coste,f,profundidad,padre));
				ftime=System.currentTimeMillis()-itime;
				tottime+=ftime;
				if (maxtime<ftime)
					maxtime=ftime;
				if (mintime>ftime)
					mintime=ftime;
			}catch(java.lang.OutOfMemoryError e){
				System.out.println(e.toString());
				break;
			}
		}
		avtime=tottime/1000;
		System.out.println("Tam: " + m.size() + "\nTiempo medio: " + avtime + 
				"\nTiempo Maximo: " + maxtime + "\nTiempo minimo: " + mintime);
	}
}
